Skip to content

Allow npipe volume type on stack file#1195

Merged
thaJeztah merged 1 commit into
docker:masterfrom
olljanat:34795-npipe-mount-type
Sep 28, 2018
Merged

Allow npipe volume type on stack file#1195
thaJeztah merged 1 commit into
docker:masterfrom
olljanat:34795-npipe-mount-type

Conversation

@olljanat

@olljanat olljanat commented Jul 8, 2018

Copy link
Copy Markdown
Contributor

- What I did
Added volume type npipe to compose file handing.

- How to verify it
Can be tested together with docked from moby/moby#37400

Pre-requirement for moby/moby#37400 to be able to fix moby/moby#34795

@silvin-lubecki

Copy link
Copy Markdown
Contributor

@simonferquel Could you take a look please?

@simonferquel simonferquel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall lgtm, just a single nitpicking on unknown mount types error message

Comment thread cli/compose/convert/volume.go Outdated
case "npipe":
return handleNpipeToMount(volume)
}
return mount.Mount{}, errors.New("volume type must be volume, bind, or tmpfs")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message should now include npipe as a valid mount type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I included it to commit now.

@simonferquel

Copy link
Copy Markdown
Contributor

Did not have time to review the moby/moby and swarmkit prs though

@olljanat olljanat force-pushed the 34795-npipe-mount-type branch 2 times, most recently from de98345 to 8178403 Compare September 12, 2018 15:31
@olljanat

Copy link
Copy Markdown
Contributor Author

@simonferquel swarmkit PR was just merged so can we also merge this one so I will be able to get that moby/moby done?

@olljanat

Copy link
Copy Markdown
Contributor Author

@vdemeester can you please look this one too?

After moby/moby#37400 is merged we will be able to use named pipes with docker service create but this one is needed to be able do same thing with stack.

@simonferquel

Copy link
Copy Markdown
Contributor

I think we should merge the moby side first

@olljanat

Copy link
Copy Markdown
Contributor Author

@simonferquel @vdemeester @thaJeztah moby/moby#37400 have been merged so can we merge this one too?

@cpuguy83 cpuguy83 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdemeester vdemeester left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Overall looking good, but I think some more changes are needed 😅 🤗. I'll make a summary

@thaJeztah

Copy link
Copy Markdown
Member

Thanks @olljanat! Looks like some changes are needed to the compose-file schema. Given that this is a new option, and the 3.7 schema is now frozen, that would involve a new schema version (3.8), and changes to this section; https://github.com/docker/cli/blob/master/cli/compose/schema/data/config_schema_v3.7.json#L279-L317

Also ping @shin- for changes in docker compose 🤗

The compose-file reference in the documentation repository will also need a slight update; https://github.com/docker/docker.github.io/blob/master/compose/compose-file/index.md#long-syntax-3, and mention the new option (that's in the documentation repository, so will be a follow up, or separate PR)

Some changes to the reference documentation are needed; the reference docs for docker service create; this section mentions the available types for --mount, so needs some information about the new type; https://github.com/docker/cli/blob/master/docs/reference/commandline/service_create.md#add-bind-mounts-volumes-or-memory-filesystems

Finally, we'll probably need some changes to the "storage" documentation for the new type; https://github.com/docker/docker.github.io/blob/master/storage/index.md That's also in the documentation repository, so can be done as a follow-up.

Perhaps we need some assistance from the documentation team for that (we can make a tracking issue if needed)

@shin-

shin- commented Sep 26, 2018

Copy link
Copy Markdown
Contributor

@thaJeztah It's already supported in docker-compose since 1.18.0 👼 docker/compose#5181

Also AFAICT, this doesn't require any changes to the schema; since we don't do any validation on the mount type field, this will work retroactively with any schema that supports the mount syntax (so 3.2+).

@olljanat

Copy link
Copy Markdown
Contributor Author

@thaJeztah I added one commit which contains service create documentation and created PR docker/docs/pull/7427 of these two other page updates.

Also please note that named pipes support have been originally added for non-swarm mode over year ago on moby/moby/pull/33852 so maybe you can also ask help from these Microsoft dudes if more detailed documentation of named pipes are needed.

@thaJeztah

Copy link
Copy Markdown
Member

Also AFAICT, this doesn't require any changes to the schema; since we don't do any validation on the mount type field, this will work retroactively with any schema that supports the mount syntax (so 3.2+).

@shin- @olljanat doh! You're right; I got confused there; the section I was pointing to is for the tmpfs, volume, and bind options to be passed as part of a volume, i.e.;

volumes:
  - type: tmpfs
    tmpfs:
      size: 12345

my bad! 😊

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating! Found some small issues in the documentation changes; could you also squash both commits? It's ok to have docs and code changes in the same commit for this PR.

into the container.</li> <li><tt>bind</tt>:
bind-mounts a directory or file from the host into the container.</li>
<li><tt>tmpfs</tt>: mount a tmpfs in the container</li>
<li><tt>npipe</tt>: mounts named pide from the host into the container.</li>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅 looks like you indented with a tab, instead of spaces here.

Also there's a typo; pide instead of pipe ☺️

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it's good to add (Windows containers only) to the description

</tr>
<tr>
<td><b>types</b></td>
<td><b>type</b></td>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice catch

<li><tt>npipe</tt>: mounts named pide from the host into the container.</li>
</ul></p>
</td>
</tr>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also update the required column at line 332 below https://github.com/docker/cli/pull/1195/files#diff-d4779426535b6679e406cf721c9f9289R332 ?

It currently says;

<td>for <tt>type=bind</tt> only></td>

Which should now be;

<td>for <tt>type=bind</tt> and <tt>type=npipe</tt></td>

(Noticed there's a stray > there as well)


A **tmpfs** mounts a tmpfs inside a container for volatile data.

A **npipe** mounts a named pide from the host into the container.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops typo: pide (should be pipe)

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
@olljanat olljanat force-pushed the 34795-npipe-mount-type branch from f50136a to 0704d9a Compare September 27, 2018 15:47
@olljanat

Copy link
Copy Markdown
Contributor Author

@thaJeztah requested changes should be in-place now.

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: Support named pipe mounts in docker service create + stack yml

8 participants